﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace Vtron.LEDCorrective
{
    public class AxisPoints
    {
        public bool BeginDrawAngle { set; get; }
        //色域三角形顶点到按下点的距离
        public double r { set; get; }
        public double g { set; get; }
        public double b { set; get; }
        public double min { set; get; } //顶点到按下点的最小距离

        public List<Point> MeasureAngleAxis = new List<Point>();//测量色域三角形三顶点色坐标
        public List<Point> TargetPointArray = new List<Point>();  //记录鼠标按下的所有位置坐标，及手动绘制的色域三角形三顶点色坐标

        //public double x { set; get; } //鼠标按下x的坐标
        //public double y { set; get; } //鼠标按下y的坐标
        public Point PressedPoints = new Point();//鼠标点击的坐标

        public int NumofMousePress { set; get; }  //鼠标按下的次数

        /// <summary>
        /// 坐标转换，屏幕坐标转换为CIE色坐标
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        public Point ScreenTransformToCIE(Point PointXY)
        {

            PointXY.X = (PointXY.X - 47) / 520;
            PointXY.Y = (470.4 - (PointXY.Y - 43.6)) / 522.6667;
            return PointXY;


        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="PointXY"></param>
        /// <returns></returns>
        public Point CIETransformToScreen(Point PointXY)
        {

            PointXY.X = 47 + 520 * PointXY.X;
            PointXY.Y = 514 - 522.6667 * PointXY.Y;
            return PointXY;


        }
    }
}
